FROM node:lts-alpine3.12

LABEL AUTHOR="none" \
      VERSION=0.1.4

ENV REPO_URL=https://gitee.com/chiv/nodejs-qr-docker.git \
    REPO_BRANCH=master

RUN set -ex \
    && apk update \
    && apk upgrade \
    && apk add --no-cache bash tzdata git moreutils curl jq openssh-client \
    && rm -rf /var/cache/apk/* \
    && ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
     && git clone -b $REPO_BRANCH $REPO_URL /data \
    && cd /data \
    && npm config set registry https://registry.npm.taobao.org \
    && npm install \
    && cp /data/docker/docker_entrypoint.sh /usr/local/bin \
    && chmod +x /usr/local/bin/docker_entrypoint.sh

WORKDIR /data
EXPOSE 3000
CMD ["docker_entrypoint.sh"]